import React,{Component} from "react";
import { View,Text } from "react-native";


class Son extends Component{
  constructor(props) {
    super(props);
    this.state = {
      showtext:true
    }

    setInterval(()=>{
      this.setState({
        showtext:!this.state.showtext
      })
    },1000)
  }

  render(props) {
    let display=this.state.showtext ? this.props.text:'';
    return(
      <View>
        <Text style={{color:'red'}}>{display}</Text>
      </View>
    )
  }
}
class Father extends Component{
  render() {
    return (
    <View style={{width:'100%',height:'100%',justifyContent:'center',alignItems:'center'}}>
      <Text>==============</Text>
      <Son text="移动1901 刘浩"></Son>
      <Text>==============</Text>
    </View>

  )
  }
}
export  default Father;
